import { LayoutItemComponent } from "./models";

class StatusCenter {
    private allLayoutComponents = new Map<string, LayoutItemComponent>()
    private registeredComponents = new Map<string, any>()

    registerVueComponent(componentName: string, componentType: any) {
        this.registeredComponents.set(componentName, componentType)
    }

    getRegisteredComponent(componentName: string) {
        return this.registeredComponents.get(componentName)
    }

    setLayoutComponent(targetID: string, component: LayoutItemComponent) {
        this.allLayoutComponents.set(targetID, component)
    }

    getLayoutComponent(targetID: string) {
        return this.allLayoutComponents.get(targetID)
    }
}

export const statusCenter = new StatusCenter()